#ifndef _H_S_PROTOCOL_PEER_POINT_H_
#define _H_S_PROTOCOL_PEER_POINT_H_

#include "SProtocolPeer.h"

namespace QWER
{
	QDLL_EXPORT QSTRUCT SProtocolPeerPoint
	{
	public:
#ifndef _USING_CLI
		SProtocolPeerPoint();
#endif
		SProtocolPeerPoint(CONST_REF(SProtocolPeer) sAddress, UINT16 m_wURI);

		inline CONST_REF(SProtocolPeer) GetPeer() QCONST_FUNC { return m_sAddress; }
		inline UINT16 GetURI() QCONST_FUNC { return m_wURI; }

	private:
		QINIT_ONLY SProtocolPeer m_sAddress;
		QINIT_ONLY UINT16 STRUCT_MEMBER_DEFINE(m_wURI, 0);
	};
}

namespace std
{
    template <>
    struct hash<QWER::SProtocolPeerPoint>
    {
    public:
        std::size_t operator()(const QWER::SProtocolPeerPoint& c) const
        {
            return m_oHash(c.GetPeer() | ((UINT64)(c.GetURI()) << 48));
        }

    private:
        std::hash<UINT64> m_oHash;
	};
}

#endif
